package a.e.b.a;

import a.e.b.b.bb;
import a.e.b.c.cb;
import a.e.b.c.o;
import a.e.b.l;
import a.i.ib;
import a.i.jb;
import a.i.n;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import java.util.*;

class t
{
  public static final String a = "y.io.graphml.graph2d.StylePropertiesSupport.IGNORE_STYLE_PROPERTY_ERRORS";
  static Class b;
  
  static void a(Set paramSet, cb paramcb, o paramo)
    throws a.e.b.c.a
  {
    boolean bool = i.i;
    int i = i.h;
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = paramSet.iterator();
    Map.Entry localEntry;
    do
    {
      do
      {
        if (!localIterator.hasNext()) {
          break;
        }
        localEntry = (Map.Entry)localIterator.next();
      } while ("y.view.hierarchy.GroupNodePainter.GROUP_STATE_STYLE".equals(localEntry.getKey()));
      localArrayList.add(localEntry);
      if (bool) {
        break label104;
      }
      if ((!bool) && (i != 0)) {
        return;
      }
      if (bool) {
        break label104;
      }
    } while (i == 0);
    if (!bool)
    {
      if (localArrayList.size() > 0) {
        label104:
        paramcb.a("StyleProperties", "http://www.yworks.com/xml/graphml");
      }
    }
    else
    {
      localIterator = localArrayList.iterator();
      if (localIterator.hasNext()) {
        paramcb.a("Property", "http://www.yworks.com/xml/graphml");
      }
      label363:
      while (bool)
      {
        localEntry = (Map.Entry)localIterator.next();
        if (!bool)
        {
          paramcb.c("name", (String)localEntry.getKey());
          if (i != 0) {
            return;
          }
        }
        if ((bool) || (localEntry.getValue() != null))
        {
          Class localClass = localEntry.getValue().getClass();
          jb localjb = a(localClass);
          if (localjb != null)
          {
            if (!bool) {}
            l locall = (l)paramo.a(b == null ? (t.b = a("a.e.b.l")) : b);
            String str = (bool) || (locall != null) ? locall.a(localClass.getName(), paramo) : localClass.getName();
            paramcb.c("class", str);
            paramcb.c("value", localjb.a(localEntry.getValue(), localClass));
            if (bool) {
              break label363;
            }
            if (i == 0) {}
          }
          else
          {
            paramo.b(localEntry.getValue());
          }
        }
        paramcb.b();
        if (i == 0) {
          break;
        }
      }
      paramcb.b();
    }
  }
  
  static jb a(Class paramClass)
  {
    return ib.c().b(paramClass);
  }
  
  static Map a(Node paramNode, a.e.b.b.t paramt)
    throws a.e.b.b.a
  {
    boolean bool = i.i;
    int j = i.h;
    HashMap localHashMap = new HashMap();
    NodeList localNodeList = paramNode.getChildNodes();
    label582:
    label594:
    label605:
    if (localNodeList != null)
    {
      int i = 0;
      label374:
      label506:
      do
      {
        if (i >= localNodeList.getLength()) {
          break;
        }
        Node localNode1 = localNodeList.item(i);
        if (!bool)
        {
          if (localNode1.getNodeType() == 1)
          {
            if (bool) {
              continue;
            }
            if ("Property".equals(localNode1.getLocalName()))
            {
              NamedNodeMap localNamedNodeMap = localNode1.getAttributes();
              Node localNode2 = localNamedNodeMap.getNamedItem("class");
              String str1 = null;
              Object localObject1;
              if (localNode2 != null)
              {
                if (!bool) {}
                localObject1 = (l)paramt.a(b == null ? (t.b = a("a.e.b.l")) : b);
                str1 = (bool) || (localObject1 != null) ? ((l)localObject1).a(localNode2.getNodeValue(), paramt) : localNode2.getNodeValue();
              }
              localNode2 = localNamedNodeMap.getNamedItem("name");
              if ((bool) || (localNode2 != null))
              {
                localObject1 = localNode2.getNodeValue();
                localNode2 = localNamedNodeMap.getNamedItem("value");
                String str2 = null;
                if ((bool) || (localNode2 != null)) {
                  str2 = localNode2.getNodeValue();
                }
                Object localObject2 = null;
                Object localObject3;
                if (!bool) {
                  if (str1 != null)
                  {
                    if (bool) {
                      break label506;
                    }
                    if (str2 != null)
                    {
                      Class localClass = null;
                      try
                      {
                        localClass = Class.forName(str1);
                      }
                      catch (ClassNotFoundException localClassNotFoundException)
                      {
                        str3 = "Unable to create instance of class " + str1 + " for style property " + (String)localObject1;
                        if (!bool)
                        {
                          if (!y.a(paramt, "y.io.graphml.graph2d.StylePropertiesSupport.IGNORE_STYLE_PROPERTY_ERRORS")) {
                            break label374;
                          }
                          n.a(str3 + ", ignoring property");
                        }
                        if (bool) {
                          continue;
                        }
                      }
                      if (j == 0) {
                        break label605;
                      }
                      throw new a.e.b.b.a(str3, localClassNotFoundException);
                      localObject3 = a(localClass);
                      if ((bool) || (localObject3 != null))
                      {
                        localObject2 = ((jb)localObject3).a(str2, localClass);
                        break label594;
                      }
                      String str3 = "No converter for string value of style property" + (String)localObject1;
                      if (!bool)
                      {
                        if (y.a(paramt, "y.io.graphml.graph2d.StylePropertiesSupport.IGNORE_STYLE_PROPERTY_ERRORS")) {
                          n.a(str3 + ", ignoring property");
                        }
                      }
                      else {
                        if (j == 0) {
                          break label594;
                        }
                      }
                      throw new a.e.b.b.a(str3);
                    }
                  }
                }
                try
                {
                  localObject2 = paramt.a(paramt, bb.a(localNode1), null);
                }
                catch (a.e.b.b.a locala)
                {
                  localObject3 = "Unable to deserialize " + (String)localObject1;
                  if (!bool)
                  {
                    if (!y.a(paramt, "y.io.graphml.graph2d.StylePropertiesSupport.IGNORE_STYLE_PROPERTY_ERRORS")) {
                      break label582;
                    }
                    n.a((String)localObject3 + ", ignoring property");
                  }
                  if (bool) {
                    continue;
                  }
                }
                if (j != 0)
                {
                  throw new a.e.b.b.a((String)localObject3, locala);
                  localHashMap.put(localObject1, localObject2);
                }
              }
            }
          }
          i++;
        }
      } while (j == 0);
    }
    return localHashMap;
  }
  
  static Class a(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.b.a.t

 * JD-Core Version:    0.7.0.1

 */